package com.example.demo.entity.two;

import org.hibernate.annotations.SQLDelete;
import org.hibernate.annotations.Where;

import javax.persistence.*;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;

/**
 * Created by pengwan on 2017/6/25.
 */
@Entity
@Table(name="B_UNITINFO")
@SQLDelete(sql = "Update B_UNITINFO SET is_del = 'true' where id=?")
@Where(clause = "is_del != 'true'")
public class UnitInfo extends EntityBaseInfo implements Serializable {
    @Id
    @GeneratedValue
    @Column(name = "unitid")
    private int unitID;

//    机组的数字编号 对水电来说冗余
//    @Column(name="unitnumber",columnDefinition = "varchar(5)")//要添加与mydevicepage的联系
////    @OneToOne(cascade=CascadeType.ALL, fetch=FetchType.EAGER)
////    @JoinColumn(name = "mydevicepage_mydevicepagesort")
//    private String unitNumber;

    @Column(name="unitname",columnDefinition = "varchar(50)")
    private String unitName;
    @Column(name="unitcapacity", columnDefinition="decimal(18,2)")
    private float unitCapacity;
    @Column(name="lastupdatetime",columnDefinition = "datetime")
    private Date lastUpdateTime;
    @Column(name="lastupdate_id")
    private int lastUpdateID;
    @Column(name="unittype",columnDefinition = "varchar(8)")
    private String unitType;
    @Column(name="unisstate",columnDefinition = "nvarchar(20)")
    private String unisState;
    @Column(name="is_ztjc",columnDefinition = "int")
    private String isZTJC;
    @Column(name = "note", columnDefinition = "nvarchar(50)")
    private String note;
    @Column(name = "is_del", columnDefinition = "nchar(10) default 'false'")
    private String isDel;
//    CMS系统 水电不含有
//    @Column(name="iscms",columnDefinition = "int")
//    private int isCMS;
    public int getUnitID() {
        return unitID;
    }

    public void setUnitID(int unitID) {
        this.unitID = unitID;
    }

//    public String getUnitNumber() {
//        return unitNumber;
//    }
//
//    public void setUnitNumber(String unitNumber) {
//        this.unitNumber = unitNumber;
//    }

    public String getUnitName() {
        return unitName;
    }

    public void setUnitName(String unitName) {
        this.unitName = unitName;
    }

    public float getUnitCapacity() {
        return unitCapacity;
    }

    public void setUnitCapacity(float unitCapacity) {
        this.unitCapacity = unitCapacity;
    }

    public Date getLastUpdateTime() {
        return lastUpdateTime;
    }

    public void setLastUpdateTime(Date lastUpdateTime) {
        this.lastUpdateTime = lastUpdateTime;
    }

    public int getLastUpdateID() {
        return lastUpdateID;
    }

    public void setLastUpdateID(int lastUpdateID) {
        this.lastUpdateID = lastUpdateID;
    }

    public String getUnitType() {
        return unitType;
    }

    public void setUnitType(String unitType) {
        this.unitType = unitType;
    }

    public String getUnisState() {
        return unisState;
    }

    public void setUnisState(String unisState) {
        this.unisState = unisState;
    }

    public String getIsZTJC() {
        return isZTJC;
    }

    public void setIsZTJC(String isZTJC) {
        this.isZTJC = isZTJC;
    }

    public String getNote() {
        return note;
    }

    public void setNote(String note) {
        this.note = note;
    }

    public String getIsDel() {
        return isDel;
    }

    public void setIsDel(String isDel) {
        this.isDel = isDel;
    }
}
